<?
  class InputSet
  {
    var $cField;
    var $oInput;
    var $oSet;
    var $bHidden;
    var $cSeparador = '|';
    
  function showActions()
    {
    }
    
  function isEmpty ()
    {
      return $this->oInput->isEmpty();
    }
  function setHidden ( $bOn = true )
    {
      $this->oSet->setHidden( $bOn );
      $this->oInput->setHidden( $bOn );
      $this->bHidden = $bOn;
    }
  function setValue( $cValue ) 
    {
      $aDatos = explode( $cthis->Separador , $cValue );
      foreach( $aDatos as $cData)
      {
        $this->aSet->addOption( $cData, $cData );
      }
    }
  function showLabel( $cDescription = '', $cAccessKey = '' )
    {
      return $this->oInput->showLabel( $cDescription , $cAccessKey );
    }
  function setMandatory( $bMandatory = true) 
  {
    $this->oSet->setMandatory( $bMandatory );
  }
  function setLabel( $cDescription , $cAccessKey  ) 
    {
      $this->oInput->setLabel( $cDescription , $cAccessKey );
    }
  function InputSet( $cLabel, $cField, $cValue = '', $bMandatory = true )     
    {
      $this->cField = $cField;
    // Crea los campos de edicion
      $this->oInput = new InputText ($cLabel,  $this->cField . '_Input' , $cValue );
      $this->oSet   = new InputList ( '', $this->cField . '_Set', $cValueDescription );
    // Configura los campos de edicion
      $this->oSet->setRows(3);
      $this->oSet->setMandatory( $bMandatory );
    // Si viene por GET el Value lo setea
      if ( getParam($cField . '_Set') )
        {
          $this->setValue( getParam($cField) );
        }      
    }
  function make()
    {
      $cReturn = '';
      if ( $this->bHidden )
      {
        $cReturn = $this->oInput->make();
      } else
      {
      // Arma y devuelve el control
        $this->oSet->setWidth( '146');
        $cReturn .= $this->oInput->make();
        $cReturn .= "<a href='#' onclick=\"javascript: addSet( '" . $this->cField . "' );return false; \" ><img src='" . URL_IMAGES . "/agregar.gif' /></a><br/>";
        $cReturn .= $this->oSet->make();
        $cReturn .= "<a href='#' onclick=\"javascript: removeSet( '" . $this->cField . "' );return false; \" ><img src='" . URL_IMAGES . "/eliminar.gif' /></a>";
      }
      return $cReturn;
    }
  function getValue()
    {
      return $this->oSet->getValue() ;
    }
  }
?>
